package be.bonamis.umpire.ui.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

public class ProfileLoader implements ApplicationContextInitializer<ConfigurableApplicationContext> {

	private static final Logger LOG = LoggerFactory.getLogger(ProfileLoader.class);

	@Override
	public void initialize(ConfigurableApplicationContext applicationContext) {
		
			String profile = "default";
	        applicationContext.getEnvironment().setActiveProfiles(profile);
	        LOG.info(" -- Loading Active Profiles: {}", profile);

//	        Class<?>[] configs = {UmpireConfig.class};
	//
//	        String[] basePkgs = new String[configs.length];
//	        int i = 0;
//	        for (Class<?> pkg : configs)
//	            basePkgs[i++] = pkg.getPackage().getName();
	//
//	        //applicationContext.scan(basePkgs);
//	        applicationContext.refresh();
			
		
	}
}
